﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="BidangDokumen.aspx.vb" Inherits="bisaska.BidangDokumen" %>
<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" runat="server"></asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<form id="FormBidangDokumen" runat="server">
<asp:ScriptManager runat="server" ID="MainScriptManager" />
<asp:UpdatePanel runat="server" ID="MainUpdatePanel">
<ContentTemplate>
<div class="title">
    <span>.::</span>
    <span><b>Master Bidang Dokumen</b></span>
    <em>::.</em>
	<em><%= DateTime.Now.ToString("dd MMMM yyyy")%></em>
	<div style="clear:both;"></div>
</div>
<asp:GridView 
    ID="BidangDokumenGridView" 
    runat="server" 
    AllowPaging="True" 
    AllowSorting="True" 
    AutoGenerateColumns="False" 
    DataKeyNames="id_bidang_dok" 
    DataSourceID="SqlDataSource1" 
    CellPadding="4"
    GridLines="None"
    AlternatingRowStyle-CssClass="odd"
    CssClass="table-data">
  <Columns>
    <asp:BoundField DataField="id_bidang_dok" HeaderText="ID BIDANG" InsertVisible="False" ReadOnly="True" SortExpression="id_bidang_dok" ItemStyle-Width="80px"/>
    <asp:BoundField DataField="BIDANG_DOK" HeaderText="NAMA BIDANG" SortExpression="bidang_dok"/>
    <asp:BoundField DataField="deskripsi" HeaderText="DESKRIPSI" SortExpression="deskripsi" />
    <asp:BoundField DataField="is_active" HeaderText="STATUS" SortExpression="is_active" ItemStyle-Width="50px"/>
    <asp:BoundField DataField="tgl_update" HeaderText="TANGGAL UPDATE" SortExpression="tgl_update" DataFormatString="{0:dd-MM-yyyy HH:mm:ss}" ItemStyle-Width="120px"/>
    <asp:ButtonField CommandName="EditCommand" Text="Edit" ItemStyle-Width="25px" />
    <asp:TemplateField ItemStyle-Width="25px">
      <ItemTemplate>
        <asp:LinkButton ID="deleteButton" runat="server" CommandName="Delete" Text="Delete" OnClientClick="return confirm('Hapus data ?');" />
      </ItemTemplate>
    </asp:TemplateField>
    <asp:ButtonField CommandName="CopyCommand" Text="Copy" ItemStyle-Width="25px"/>
  </Columns>
</asp:GridView>
<div class="paging">
  <em><asp:Button ID="AddButton" runat="server" Text="Add New" CausesValidation="False" CssClass="button" /></em><div style="clear:both;"></div>
</div> 
  <table runat="server" id="BidangDokumenTabelForm" cellpadding="0" cellspacing="2" border="0" class="table-form">
    <tr>
      <th style="width:140px;">ID Bidang</th>
      <td><asp:TextBox ID="ID" runat="server" ReadOnly="true" Columns="5" Enabled="false"></asp:TextBox></td>
    </tr>
    <tr>
      <th>Nama Bidang Dokumen</th>
      <td>
        <asp:TextBox ID="BidangDokumen" runat="server" Columns="50" MaxLength="50"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="BidangDokumen" ErrorMessage="*"></asp:RequiredFieldValidator>
      </td>
    </tr>
    <tr>
      <th valign="top">Deskripsi</th>
      <td>
         <asp:TextBox ID="Deskripsi" runat="server" TextMode="multiline" MaxLength="50" Rows="3" Columns="50"></asp:TextBox>
         <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Deskripsi" ErrorMessage="*"></asp:RequiredFieldValidator>
      </td>
    </tr>
    <tr>
      <th>Status</th>
      <td>
        <asp:DropDownList ID="Status" runat="server">
          <asp:ListItem Value="0">Aktif</asp:ListItem>
          <asp:ListItem Value="1">Pasif</asp:ListItem>
        </asp:DropDownList>
      </td>
    </tr>
    <tr>
      <td></td>
      <td>
        <asp:Button ID="SaveButton" runat="server" Text="Save" CssClass="button"></asp:Button>
        <asp:Button ID="CancelButton" runat="server" Text="Cancel" CssClass="button" CausesValidation="False"></asp:Button>
      </td>
    </tr>
  </table>
<asp:SqlDataSource 
    ID="SqlDataSource1" 
    runat="server" 
    ConnectionString="<%$ ConnectionStrings:bisaska %>" 
    SelectCommand="SELECT [id_bidang_dok], [bidang_dok], [deskripsi], [is_active] = case [is_active] when 0 then 'Aktif' when 1 then 'Pasif' end, tgl_update  FROM [T_MST_BIDANG_DOK]" 
    
        DeleteCommand="DELETE FROM [T_MST_BIDANG_DOK] WHERE [id_bidang_dok] = @id_bidang_dok" >
    <DeleteParameters>
      <asp:Parameter Name="id_bidang_dok" Type="Int64" />
    </DeleteParameters>
</asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</asp:Content>
